home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / pkey12_1.zip / GL.LSP < prev    next >
Text File  |  1992-09-13  |  2KB  |  43 lines

  1. ;Paste lines or arcs together (kinda glitchy but it works and wont nuke
  2. ;anything)
  3. ;
  4. (defun c:gl()
  5. (setq oer *error* *error* err2)
  6. (setq e1(car(entsel "\nPick first entity : ")))
  7. (setq e2(car(entsel "\nPick second entity: ")))
  8. (if(equal e1 e2)(err))
  9. (setq et1(cdr(assoc 0(entget e1))))
  10. (if(= et1 "LINE")(ga))
  11. (setq cp1(cdr(assoc 10(entget e1))))
  12. (setq cp3(cdr(assoc 10(entget e2))))
  13. (setq la1(cdr(assoc 8(entget e1))))
  14. (setq asp1(polar cp1(cdr(assoc 50(entget e1)))(cdr(assoc 40(entget e1)))))
  15. (setq asp2(polar cp1(cdr(assoc 51(entget e1)))(cdr(assoc 40(entget e1)))))
  16. (setq asp3(polar cp3(cdr(assoc 50(entget e2)))(cdr(assoc 40(entget e2)))))
  17. (setq asp4(polar cp3(cdr(assoc 51(entget e2)))(cdr(assoc 40(entget e2)))))
  18. (command"erase" e1 e2 "")
  19. (if(<(distance asp1 asp3)(distance asp1 asp4))
  20. (setq ep asp4 mp asp3 d(distance asp1 asp3))
  21. (setq ep asp3 mp asp4 d(distance asp1 asp4)))
  22. (if(<(distance asp2 asp3)(distance asp2 asp4))
  23. (setq ep1 asp4 mp1 asp3 d1(distance asp2 asp3))
  24. (setq ep1 asp3 mp1 asp4 d1(distance asp2 asp4)))
  25. (if(< d d1)
  26. (command "arc" asp2 mp ep)
  27. (command "arc" asp1 mp1 ep1))
  28. (command "change"(entlast)"" "p" "la" la1 "")
  29. (princ))
  30. (defun ga()
  31. (setq pt1(cdr(assoc 10(entget e1))))
  32. (setq pt2(cdr(assoc 11(entget e1))))
  33. (setq pt3(cdr(assoc 10(entget e2))))
  34. (setq pt4(cdr(assoc 11(entget e2))))
  35. (command "erase" e2 "")
  36. (if(>(distance pt1 pt3)(distance pt1 pt4))
  37. (command "change" e1 "" pt3)
  38. (command "change" e1 "" pt4))
  39. (setq asp1 nil asp2 nil asp3 nil asp4 nil pt1 nil pt2 nil pt3 nil pt4 nil ep nil ep1 nil e1 nil e2 nil ct1 nil ct3 nil la1 nil)
  40. (princ)(princ)
  41. (setq *error oer)
  42. (princ))
  43. (princ "\nGlue to lines or arcs together. Type GL to execute.")